/*!
 * @brief       	配置串口在停止模式下的唤醒   	
 *
 * @param 	[in]	huart: UART_HandleTypeDef类型的器件
 *					[in]	EnableNotDisable: 使能或者关闭
 *
 * @return				None
 */
void Ctrl_UART_StopMode_WakeUp(UART_HandleTypeDef *huart,bool EnableNotDisable)
{	
	if(EnableNotDisable)
	{
		__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);	//保留唤醒用的HSI线 串口初始化时钟也必须要配置为HSI
	
		UART_WakeUpTypeDef UART_WakeUpStruct={0};
		UART_WakeUpStruct.WakeUpEvent=UART_WAKEUP_ON_READDATA_NONEMPTY;  //接收数据不为空时唤醒
		HAL_UARTEx_StopModeWakeUpSourceConfig(huart,UART_WakeUpStruct);
	
		__HAL_UART_ENABLE_IT(huart,UART_IT_WUF);	//开启唤醒中断
		HAL_UARTEx_EnableClockStopMode(huart);
		HAL_UARTEx_EnableStopMode(huart);		//开启模式
	}
	else
	{
		__HAL_UART_DISABLE_IT(huart,UART_IT_WUF);	//关闭唤醒中断
		HAL_UARTEx_DisableClockStopMode(huart);
		HAL_UARTEx_DisableStopMode(huart);		//关闭模式
	}
}
